<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Types 测试
 */
class IOSS_User_Test extends CI_Controller {

	function __construct(){
		parent::__construct();
		if(ENVIRONMENT == 'production' ){
			exit('enviroment is production');
		}
		$this->load->library('unit_test');
		$this->unit->use_strict(true);
	}
	
	function index(){
		$u = IOSS_User::getById(1);
		//var_dump($u);
		$u->password = IOSS_User::hashPassword('0');
		$u->save();
		
		$u = IOSS_User::login('test', '0');
		var_dump($u);
		
		$acc = 'test2';
		if(!IOSS_User::isExistAccount($acc)) {
			$id = IOSS_User::register($acc, 'xxxxxxx');
			var_dump($id);
		}
		echo $this->unit->report();
	}
	
	/**
	 * 测试用户注册
	 */
	function testReg(){

	}
}